import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            boolean bool = false;
            while (sc.hasNext()) {
            	int coef = sc.nextInt();
            	int expon = sc.nextInt();
            	if (coef * expon != 0) {
                if (bool) {
                 System.out.print(" ");
                } else {
                    bool = true;
                }
                 System.out.print(coef * expon + " " + (expon - 1));
            }else {
                    break;
                }
        }
            if (!bool) {
               System.out.print("0 0");
        }
    }
}
                    
